﻿<UserControl xmlns:PageBar="clr-namespace:Mengsk.ProxyDelivery.App.UI.PageBar"  x:Class="Mengsk.ProxyDelivery.App.UI.Sms.SmsHistoryUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
             d:DesignHeight="300" d:DesignWidth="1000" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Grid.Row="0" >

            <TextBlock Text="类型:" Margin="3" VerticalAlignment="Center" />
            <ComboBox Name="cbbTypes" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="卖家编号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbTargetId" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="电话号码:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbPhone" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="生成时间:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker Name="dpStart" Width="130" Format="Custom" FormatString="yyyy-MM-dd HH:mm:ss" VerticalAlignment="Center"/>
            <TextBlock Text="到:" Margin="3" VerticalAlignment="Center"/>
            <xctk:DateTimePicker Name="dpEnd" Width="130" Format="Custom" FormatString="yyyy-MM-dd HH:mm:ss" VerticalAlignment="Center"/>
            <Button Content="查询" Name="btnQuery" Width="80" Click="btnQuery_Click" VerticalAlignment="Center" Margin="3"/>
            <Button Content="更改时间" Name="btnModifyTime" Width="80" Click="btnModifyTime_Click" VerticalAlignment="Center" Margin="3"/>
        </StackPanel>

        <DataGrid Grid.Row="1" IsReadOnly="True" AutoGenerateColumns="False" GridLinesVisibility="All" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" Name="dgvItems">
            <DataGrid.Columns>
                <DataGridTextColumn Header="编号" Binding="{Binding Id}"/>
                <DataGridTextColumn Header="类型" Binding="{Binding Type,Converter={StaticResource descriptionConverter}}"/>
                <DataGridTextColumn Header="目标编号" Binding="{Binding TargetId}"/>
                <DataGridTextColumn  Header="手机号码" Binding="{Binding Phone}"/>
                <DataGridTextColumn Header="IP地址"  Binding="{Binding IpAddress}"/>
                <DataGridTextColumn Header="发送内容" Binding="{Binding Content}"/>
                <DataGridTextColumn Header="创建时间" Binding="{Binding CreateTime,Converter={StaticResource datetimeConverter}}"/>
                <DataGridTextColumn Header="结束时间" Binding="{Binding EndTime,Converter={StaticResource datetimeConverter}}"/>
            </DataGrid.Columns>
        </DataGrid>

        <PageBar:PageBarUserControl Grid.Row="2" x:Name="pbBar" PageSize="200"  PageChanging="pbBar_PageChanging"/>
    </Grid>
</UserControl>
